<%--
  Created by IntelliJ IDEA.
  User: zhaocan
  Date: 2018/5/3
  Time: 10:46
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/WEB-INF/pages/common/meta.jsp"%>
<div class="ys-module-wrap huru-box">
    <div class="ys-module-title">
        <h2>近七日呼入概况</h2>
    </div>
    <div class="ys-module-con" style="height: 255px;">
        <div id="sevenDayInfrushChart" style=" width: 100%; height: 255px;"></div>
    </div>
</div>
<script type="text/javascript">
    //初始化近七日呼入量统计
    function initsevenDayInfrushChart() {
        uceAjax(G_CTX_PATH+"/callCenter/agentcall/getSevenDayInfrushStatistics.do", {}, function(result){
            var dateArray =new Array();
            var callincountArray =new Array();
            var ringcountArray =new Array();
            var givevountArray =new Array();

            for(var i=0;i<result.length;i++)
            {
                dateArray.push(result[i].DATE);
                callincountArray.push(result[i].CALLIN_COUNT);
                ringcountArray.push(result[i].RING_COUNT);
                givevountArray.push(result[i].GIVE_COUNT);
            }
            var sevenDayInfrushChart = echarts.init(document.getElementById('sevenDayInfrushChart'));
            var sevenDayInfrushOption = {

                tooltip: {
                    trigger: 'axis'
                },
                legend: {
                    data:['呼入','接通','放弃']
                },
                grid: {
                    left:'3%',
                    right:'6%',
                    bottom: '2%',
                    containLabel: true
                },

                xAxis: {
                    type: 'category',
                    boundaryGap: false,
                    data: dateArray
                },
                yAxis: {
                    type: 'value'
                },
                series: [
                    {
                        name:'呼入',
                        type:'line',
//                    stack: '总量',
                        data:callincountArray
                    },
                    {
                        name:'接通',
                        type:'line',
//                    stack: '总量',
                        data:ringcountArray
                    },
                    {
                        name:'放弃',
                        type:'line',
//                    stack: '总量',
                        data:givevountArray
                    }
                ]
            };
            sevenDayInfrushChart.setOption(sevenDayInfrushOption);

        }, "GET");

    }
    initsevenDayInfrushChart();
    function setCanvasWidth(){
        $("#sevenDayInfrushChart").children('div').css({'width':'100%'})
        $("#sevenDayInfrushChart").children('div').children('canvas').css({'width':'100%'})
    }
    setCanvasWidth();
    $(window).resize(function(){
        setCanvasWidth();
    })
</script>
